<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>新增</title>
</head>
<script type="text/javascript" src="${pageContext.request.contextPath }/statics/js/jquery-3.5.1.js"></script>
<script type="text/javascript">
	$("#sub").click(function (){
		$.ajax({
			type: "post",
			url: "${pageContext.request.contextPath}/add.do",
			data:{
				"username":username,
				"password":password,
				"permissons":permissons
			},
			success: function(result){
			//	window.location.href="${pageContext.request.contextPath}/page3.doo";
			}
		});

	});

	/* function b(){
		alert("adsf");
		$("#f")[0].reset();
	} */
	$("#btn").click(function(){
		alert("adsf");
		$("#f")[0].reset();
	});
</script>
<body>
	<form id="f" action="#" method="post">
		<input type="text" name="username" placeholder="请输入用户名" required="required"><br>
		<input type="password" name="password" placeholder="请输入密码" required="required"><br>
		<input type="text" name="permissons" placeholder="请输入权限" required="required"><br>
		<input type="submit" id="sub" value="添加">
		<button type="button" id="btn" >重置</button>
	</form>
</body>
</html>